<template>
  <div class="ceshitable">
    <el-table :data="tableData" height="250" border style="width: 100%">
      <el-table-column
        v-for="(column, index) in tableColumns"
        :key="index"
        :prop="column.prop"
        :label="column.label"
      >
        <template slot-scope="scope">
          <div v-if="scope.$index == 0">
            <div v-if="column.type == '1'">
              <el-input></el-input>
            </div>
          </div>
          <div v-else>
            <span>{{ scope.row[column.prop] }}</span>
          </div>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>
<script>
export default {
  name: "ceshitable",

  data() {
    return {
      tableData: [
        {
          date: "2016-05-03",
          name: "Tom",
          address: "No. 189, Grove St, Los Angeles",
        },
        {
          date: "2016-05-02",
          name: "John",
          address: "No. 189, Grove St, Los Angeles",
        },
        {
          date: "2016-05-04",
          name: "Morgan",
          address: "No. 189, Grove St, Los Angeles",
        },
        {
          date: "2016-05-01",
          name: "Jessy",
          address: "No. 189, Grove St, Los Angeles",
          title_list: "张三222",
          change_list: "国家",
        },
      ],
      tableColumns: [
        { label: "时间", prop: "date", type: "1", title: "时间" },
        {
          label: "名字",
          prop: "name",
          type: "2",
          title: "姓名",
          options: [
            { value: "1", label: "张三" },
            { value: "2", label: "李四" },
          ],
        },
        {
          label: "地址",
          prop: "address",
          type: "3",
          url: "/api/company/region",
          url_param: { pid: 0 },
        },
        {
          label: "名字列表",
          prop: "title_list",
          type: "4",
        },
        {
          label: "change_list",
          prop: "change_list",
          type: "5",
          url: "/api/company/customer/box",
          url_param: {
            name: "",
            id: "",
            is_send: "1",
            is_receive: "",
          },
        },
      ],
    };
  },
  watch: {},
  computed: {},
  created() {},
  mounted() {},
  methods: {
    myFunction() {
      // console.log("内容的")
    },
  },
};
</script>
<style lang="less" scoped>
.ceshitable {
  width: 100%;
  background: red;
  height: 100px;
}
</style>